package com.kong.configuration;

import com.kong.util.MD5Util;
import org.springframework.security.crypto.password.PasswordEncoder;
import sun.security.provider.MD5;

/**
 * @Author: Kong
 * @DateTime: 2022/9/8 15:32
 * @Description: TODO
 */
public class MyPasswordEncoder implements PasswordEncoder {
    @Override
    public String encode(CharSequence charSequence) {
        return MD5Util.getSaltMD5(charSequence.toString());
    }

    @Override
    public boolean matches(CharSequence charSequence, String s) {
        return MD5Util.getSaltverifyMD5(charSequence.toString(),s);
    }
}
